package minio

import (
	"github.com/gin-gonic/gin"
)

// MinioService MinIO服务
type MinioService struct{}

// NewMinioService 创建MinIO服务
func NewMinioService() *MinioService {
	return &MinioService{}
}

// RegisterRoutes 注册路由
func (s *MinioService) RegisterRoutes(router *gin.RouterGroup) {
	// Bucket管理
	router.GET("/minio/buckets", ListBucketsHandler)
	router.POST("/minio/buckets", CreateBucketHandler)

	// 文档管理
	router.GET("/minio/:bucketName/documents", GetBucketDocumentsHandler)
	router.POST("/minio/:bucketName/upload/batch", BatchUploadDocumentsHandler)
	router.POST("/minio/:bucketName/upload/parse", UploadAndParseDocumentHandler) // 新增文档解析接口
	router.POST("/minio/:bucketName/upload", UploadDocumentHandler)
	router.GET("/minio/:bucketName/parse/status/:fileName", GetParseStatusHandler) // 文档解析进度查询接口
	router.GET("/minio/:bucketName/download/:objectName", DownloadDocumentHandler)
	router.GET("/minio/:bucketName/url/:objectName", GetDocumentURLHandler)
	router.DELETE("/minio/:bucketName/document/:objectName", DeleteDocumentHandler)
}
